# coding= utf-8
from aip import AipOcr

# 引入三个参数
api_id = '15585176'
api_key = 'U0eFn5xGRvdOpWZPqicVpOQf'
secret_key = 'Qel75q5F6V7THdLk8ExHu4ZZbGIiQ2YB'
client = AipOcr(api_id,api_key,secret_key)
# 以上都是固定用法

# 读取图片信息
with open('identify.jpg','rb') as f:
    img = f.read()

# 存入百度API处理的结果值
text = client.basicGeneral(img)
# 这是打印原结果字典形式
print(text)
# 依次打印所处理的结果,找到 words_result 字典项
for each in text.get('words_result'):
    print(each.get('words'))